home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 169
/
169.d81
/
monkey match
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
11KB
|
388 lines
8 poke53371,0
10 poke53280,.:poke53281,.:print"":gosub2860:gosub1680
20 rem -- main screen --
30 poke53281,.:poke53280,6:print"[147]"
40 printtab(30)"[149][216][217][218][219]":printtab(30)"[129][220][221][255][223]"
50 printtab(30)"[160][161][162][163]":printtab(30)"[164][165][166][167]"
60 printtab(27)" player 1 ":printtab(26)"score : 0000"
70 printtab(30)"[150][200][201][202][203]":printtab(30)"[204][205][206][207]"
80 printtab(30)"[208][209][210][211]":printtab(30)"[155][212][213][214][215]"
90 printtab(27)" player 2 ":printtab(26)"score : 0000"
100 printtab(25)" "
110 print" letter animal "
120 printtab(25)"[152]abcdefghijklm"
130 print" help credits quit ";
140 print"[146][152]nopqrstuvwxyz"
150 fori=1to30:sysml+36,i,27,14:next
160 rem -- setup --
170 sysml+39,224:sysml+30,11,28,10,14,160,20
180 poke214,11:print:printtab(13)"[156]monkey mixing!"
190 pokev+2,35:pl=0:mv=0:sc(1)=0:sc(2)=0
200 fori=.to1:forj=1to15:a%(i*15+j)=j:next:next
210 fori=1to30:f=int(rnd(1)*30+1):x=a%(i):a%(i)=a%(f):a%(f)=x:next
220 fori=.to25:poke832+i,.:next
230 an$=a$(rnd(1)*a%):tb=32-len(an$)/2
240 sysml+42,224
250 poke214,19:print:printtab(tb);
260 fori=1tolen(an$)
270 ifmid$(an$,i,1)=" "thenprint" ";:goto290
280 print"[154]]";
290 next
300 rem -- begin --
310 sysml+12,27,6," player 1 "
320 sysml+12,27,15," player 2 "
330 pl=pl+1:ifpl>2thenpl=1
340 poke214,(pl-1)*9+5:print:printtab(27)"[156] player"pl"[157] "
350 rem -- main --
358 sysml+21,xa,ya
360 sysml+9:ifcr%then390
362 sysml+60,"[145][157]":ifi%=0then360
364 ifi%=1thenya=ya-1:ifya<0thenya=0
365 ifi%=2thenya=ya+1:ifya>24thenya=24
366 ifi%=3thenxa=xa-1:ifxa<0thenxa=0
367 ifi%=4thenxa=xa+1:ifxa>39thenxa=39
370 goto358
380 rem -- display 1st animal --
390 ifcr%>30then690
400 ifa%(cr%)=0orcr%=mvthen360
410 ifmvthen480
420 sysml+36,cr%,32,0
430 f=a%(cr%):sysml+129,f2+(f-1)*72,f2+(f-1)*72+72,f1+1792
440 poke214,int((cr%-1)/6)*4:print
450 poke646,cl(f):f=peek((cr%-1)*4+rl):printtab(f)a1$
460 gosub2510:mv=cr%:goto360
470 rem -- display 2nd animal --
480 sysml+36,cr%,32,0
490 f=a%(cr%):sysml+129,f2+(f-1)*72,f2+(f-1)*72+72,f1+1864
500 poke214,int((cr%-1)/6)*4:print
510 poke646,cl(f):f=peek((cr%-1)*4+rl):printtab(f)a2$
520 gosub2510:poke53370,0:forde=.to500:next:poke53371,0
530 ifa%(mv)=a%(cr%)then580
540 rem -- no match --
550 gosub2640:sysml+36,mv,27,14:sysml+36,cr%,27,14
560 mv=0:goto310
570 rem -- match --
580 gosub2550:sc(pl)=sc(pl)+100:gosub630
590 a%(cr%)=0:a%(mv)=0
600 sysml+36,mv,32,0:sysml+36,cr%,32,0
610 mv=0:goto360
620 rem -- update score --
630 a$=str$(sc(pl)):a$=right$(a$,len(a$)-1)
640 poke214,(pl-1)*9+7:print
650 printtab(34)"0000[145]"
660 printtab(38-len(a$))a$
670 return
680 rem -- options --
690 sysml+36,cr%,255,1
700 oncr%-30goto720,890,1880,1270,1560
710 rem -- guess letter --
720 t=0:ifsc(pl)=0ormvthengosub2600:sysml+36,cr%,255,6:goto360
730 gosub2510:sysml+36,cr%,255,6
740 sysml+12,25,18,"[156]what letter? ":f=49910
742 poke198,0
750 x=peek(f)and127:t=t+1and15:pokef,x-(t<8)*128
760 geta$:ifa$<"a"ora$>"z"then750
770 print"[146][157]"a$
780 printtab(25)"[145] "
790 ifpeek(832+asc(a$)-65)thengosub2600:goto360
800 fl=0:fori=1tolen(an$)
810 ifa$=mid$(an$,i,1)thenprinttab(tb);:printspc(i-1)""a$"[145]":gosub2510:fl=1
820 next
830 f=asc(a$)-64:poke831+f,1
840 poke214,21-(f>13):print
850 f=(f>13)*13+f:printtab(24+f)""a$
860 sc(pl)=sc(pl)-25:gosub630:iffl=0thengosub2640:goto310
870 goto360
880 rem -- guess animal --
890 ifsc(pl)<50ormvthengosub2600:sysml+36,cr%,255,6:goto360
900 gosub2510:sysml+36,cr%,255,6
910 sysml+39,224
920 sysml+12,26,18,"[156]what animal?[136]"
930 t=0:x1=49912+tb:x2=x1+len(an$)-1:f=x1
940 x=peek(f)and127:t=t+1and15:pokef,x-(t<8)*128
950 geta$:ifa$=""then940
960 ifa$=chr$(13)thenpokef,peek(f)and127:goto1090
970 ifa$=chr$(20)thenpokef,32:gosub1060:goto940
980 ifa$=""thenpokef,peek(f)and127:goto1030
990 ifa$="[157]"thenpokef,peek(f)and127:gosub1060:goto940
1000 ifa$=" "thenpokef,32:goto1030
1010 ifa$<"a"ora$>"z"then950
1020 pokef,asc(a$)-64
1030 f=f+1:iff>x2thenf=x2
1040 t=0:goto940
1050 rem -- delete/crsr left --
1060 f=f-1:iff<x1thenf=x1
1070 t=0:return
1080 rem -- check answer --
1090 print"[145] "
1100 f=0:x1=49911+tb:fori=1tolen(an$)
1110 x=peek(x1+i):ifx=32andmid$(an$,i,1)=" "then1130
1120 ifasc(mid$(an$,i,1))<>x+64thenf=1
1130 next
1140 iff=1thengosub2640:sysml+42,224:sc(pl)=sc(pl)-50:gosub630:goto310
1150 rem -- winner --
1160 gosub2710:poke214,(pl-1)*9+5:print
1170 fori=.to1
1180 printtab(27)" [156] winner [146] "
1190 gosub2510:forde=.to300:next
1200 printtab(27)"[145] player"pl"[157] [145]"
1210 gosub2510:forde=.to300:next
1220 next
1230 printtab(27)" winner [146] "
1240 gosub2510:forde=.to300:next
1250 goto1460
1260 rem -- credits --
1270 gosub2510:sysml+36,cr%,255,6
1280 sysml+39,224
1290 sysml+30,5,34,8,16,160,19
1300 poke214,9:print
1310 printtab(7)"[159]program, design & graphics"
1320 printtab(12)"pineapple monkey"
1330 printtab(7)"mr mouse jr sound effects"
1340 printtab(8)"lee novak ls programs"
1350 sysml+9:ifl2%=0then1350
1360 sysml+42,224:goto360
1370 rem -- box 1 --
1380 pokev+10,32:pokev+11,66:pokev+12,67:pokev+13,64:pokev+14,65
1390 pokev+15,68:pokev+16,69:pokev+17,70:pokev+18,71
1400 return
1410 rem -- box 2 --
1420 pokev+10,160:pokev+11,105:pokev+12,111:pokev+13,104:pokev+14,110
1430 pokev+15,106:pokev+16,107:pokev+17,108:pokev+18,109
1440 return
1450 rem -- play again? --
1460 pokev+2,39:sysml+39,224
1470 sysml+30,5,34,8,16,160,24
1480 poke214,9:print
1490 printtab(7)"[129]do you want to play again?"
1500 sysml+30,11,15,12,14,160,26:sysml+30,24,28,12,14,160,26
1510 printtab(13)"[150]y[129]or[150]n"
1520 sysml+9:sysml+60,"yn":if(cr%<38)and(i%=0)then1520
1530 gosub2510:if(cr%=38)or(i%=1)then30
1540 poke53269,.:sysml+126,4,24:sysml+3:goto40000
1550 rem -- quit --
1560 gosub2510:sysml+36,cr%,255,6
1570 pokev+2,37:sysml+39,224
1580 sysml+30,8,31,8,16,160,26
1590 poke214,9:print
1600 printtab(10)"[150]do you want to quit?"
1610 sysml+30,12,16,12,14,160,20:sysml+30,23,27,12,14,160,20
1620 printtab(14)"[156]y[150]or[156]n"
1630 sysml+9:sysml+60,"yn":if(cr%<36)and(i%=0)then1630
1640 gosub2510
1650 sysml+42,224:if(cr%=36)or(i%=1)then1460
1660 pokev+2,35:goto360
1670 rem -- title screen --
1680 print"[147]":poke53265,11:gosub1380
1690 sysml+126,192,240
1700 sysml+30,0,39,0,24,27,14
1710 sysml+30,3,38,4,22,27,6
1720 sysml+30,2,37,3,21,27,31
1730 poke214,4:print
1740 printtab(5)"[198][197][146]loadstar proudly[198][197]"
1750 printtab(4)"[217] [255]"tab(32)"[217] [255]"
1760 printtab(5)"[255][217][146]presents[255][217]"
1770 print"[158][192][193][194][195][200][196][192][197][194][192][198][199][195][200][201][192][194][192][193][194][195][200][196][202] [203][195][200][201][192][194]"
1780 print"[150][204][213][205][204][205][204] [205][204] [207][204][208][215][209][216][204][213][205][204][210][205] [204][204][211][205]"
1790 print"[129][212][214][215][219][216][212][217][214][212][217][218][215][219][220][221][212][214][212][214][221][215][219][220][212][214]"
1800 printtab(9)"[156]a game for two players"
1810 printtab(10)"on the commodore 64!"
1820 printtab(4)"(c) 1998 by j&f publishing, inc."
1830 gosub2710:poke53265,27:poke53280,6
1840 sysml+9:ifl2%=0then1840
1850 gosub2510:gosub1420
1860 sysml+6,50432:return
1870 rem -- directions --
1880 gosub2510:sysml+36,cr%,255,6
1890 sysml+39,224:gosub1380
1900 sysml+129,f2+1792,f2+2048,f1+1792
1910 poke53281,.:poke53280,.:print"[147]"
1920 sysml+30,0,39,0,24,30,6
1930 sysml+30,1,38,1,23,30,31
1940 printtab(15)"[159]directions"
1950 print"[149][216][217][218][219]"
1960 print"[129][220][221][255][223][156]hello, it is so nice to meet"
1970 print"[129][160][161][162][163][156]you. i am pineapple monkey,"
1980 print"[129][160][161][162][163][146][156]and i would like to welcome"
1990 print"[164][165][166][167][146][156]you to my latest game,"
2000 print"[168][169][170][171][146][156]monkey match. it is a game"
2010 print"[172][173][174][175][146][156]for two players, so i hope"
2020 pri